from django.db import models
from . import Company  # 假设 Company 模型已定义，需要根据实际情况调整导入路径

class Activity(models.Model):
    id = models.BigAutoField(primary_key=True)
    title = models.CharField(max_length=200, verbose_name='活动标题')
    content = models.TextField(verbose_name='活动内容')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    start_time = models.DateTimeField(verbose_name='活动开始时间')
    end_time = models.DateTimeField(verbose_name='活动结束时间')
    # 假设 Company 是已经定义好的公司模型
    hosting_company = models.ForeignKey(Company, on_delete=models.CASCADE, verbose_name='活动举办公司')
    participant_scale = models.IntegerField(verbose_name='活动人数规模')

    class Meta:
        db_table = 'activity'
        verbose_name = '活动'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title
